<h1>Products List</h1>
<div class="main_list_products">
    <ul class="featureGridRow featuredEntries">
        <?php foreach ($products as $product): ?>
        <li>
            <a href="<?php echo url_for('product/edit?id_product='.$product->getIdProduct()) ?>">
                <?php $uploadProduct = sfConfig::get('sf_upload_dir').'/products/'.$product->getIdUser().'/small_'.$product->getImage(); ?>
                <?php if(file_exists($uploadProduct)): ?>
                    <?php echo image_tag('/uploads/products/'.$product->getIdUser().'/small_'.$product->getImage(), 'class="" width="212" height="159"')?>
                <?php else:?>
                    <?php echo image_tag('no_image_available.jpg', 'border=0 class="" width="212" height="159"');?>
                <?php endif;?>
            </a>
            <div class="postDetails">
                <h3><a href="<?php echo url_for('product/edit?id_product='.$product->getIdProduct()) ?>"><?php echo $product->getNameProduct() ?></a></h3>
            </div>
        </li>
        <?php endforeach; ?>
    </ul>
    
                
    
</div>
<div style="margin-top: 25px;">
<a href="<?php echo url_for('product/new') ?>">Nuevo Producto</a>
</div>
